package com.hz.annotation;

import com.hz.validation.StateValidation;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.*;

@Documented
@Constraint(
        validatedBy = {StateValidation.class}
)
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface State {

    String message() default "{state's value must be '已发布' or '草稿'....}";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

}
